<%-- 
    Document   : classification
    Created on : Nov 5, 2011, 10:27:45 PM
    Author     : xjuraj
--%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<s:layout-render name="/WEB-INF/pages/layout.jsp">
    <s:layout-component name="head">

    </s:layout-component>
    <s:layout-component name="title">
        <f:message key="page.classification.title"/>
    </s:layout-component>
    <s:layout-component name="afterTitle">
            <c:out value="${numberRemaining}" /> <f:message key="page.classification.remaining"/>
    </s:layout-component>
    <s:layout-component name="content">
    <s:useActionBean 
        beanclass="sk.lieskove.jianghongtiao.paris.webclient.web.ClassificationActionBean"
        var="classify"/>
<div class="post">
    <h2 class="title"><c:out value="${classify.classificationItem.title}" /></h2>
        <p class="meta">
            <em>
                <strong><f:message key="page.classification.serviceName"/></strong>: 
                    ${classify.classificationItem.serviceName}
                <strong><f:message key="page.classification.fetchTime"/></strong>: 
                    ${classify.classificationItem.fetchTime}
            </em>
        </p>
        <div class="entry">
            <h3><f:message key="page.classification.originalDocument"/></h3>
            <iframe src="<s:url beanclass="sk.lieskove.jianghongtiao.paris.webclient.web.ClassificationActionBean"
                   event="getOriginalDocument"
                   ><s:param name="csId" value="${classify.classificationItem.csId}"/></s:url>" 
                    scrolling="auto" width="900" height="700">
            </iframe>
            <h3><f:message key="page.classification.extractedText"/></h3>
            <textarea readonly="true" rows="15" cols="98" 
                      scrolling="auto">${classify.extractedText}</textarea>
        </div>
    </div>
    </s:layout-component>
    <s:layout-component name="sidebar">

    <s:useActionBean 
        beanclass="sk.lieskove.jianghongtiao.paris.webclient.web.ClassificationActionBean"
        var="classify" />
    <ul>
        <li>
            <h2><f:message key="page.classification.info"/></h2>
            <s:form acceptcharset="UTF-8" method="GET" 
                    beanclass="sk.lieskove.jianghongtiao.paris.webclient.web.ClassificationActionBean">
                <fieldset>
                    
                    <h3><f:message key="page.classification.langCode"/></h3>
                    <s:select name="languageName" value="${classify.classificationItem.languageName}">
                        <s:options-enumeration 
                            enum="sk.lieskove.jianghongtiao.websearch.document.preprocessing.SupportedLanguages" 
                            />
                    </s:select>
                    <s:hidden name="csId" value="${classify.classificationItem.csId}"/>
                    <s:hidden name="csId" value="${classify.classificationItem.wsdId}"/>
                    <br>
                    <h3><f:message key="page.classification.documentType"/></h3>
                    
                    <c:forEach items="${documentTypeEnum}" var="docType">
                        <s:submit name="${fn:toLowerCase(docType)}">
                            <f:message key="sk.lieskove.jianghongtiao.paris.core.classification.document.enums.DocumentType.${docType}"/>
                        </s:submit>
                    </c:forEach>
                    <s:submit name="skip"><f:message key="page.classification.skip"/></s:submit>
                </fieldset>
            </s:form>
            
            <h3><f:message key="page.classification.url"/></h3>
            <ul>			
                <li>
                    <a href="${classify.classificationItem.url}">
                        <c:out value="${classify.classificationItem.trimUrl}"/>
                    </a>
                </li>
            </ul>
            <h3><f:message key="page.classification.searchQuery"/></h3>
            <p>${classify.classificationItem.searchQuery}</p>
            <h3><f:message key="page.classification.serviceName"/></h3>
            <p>${classify.classificationItem.serviceName}</p>
            <h3><f:message key="page.classification.fetchTime"/></h3>
            <p>${classify.classificationItem.fetchTime}</p>
            <h3><f:message key="page.classification.encoding"/></h3>
            <p><c:out value="${classify.classificationItem.encoding}" default="-"/></p>
            <h3><f:message key="page.classification.fileSize"/></h3>
            <p>${classify.classificationItem.fileSize}</p>
            <h3><f:message key="page.classification.mimeType"/></h3>
            <p>${classify.classificationItem.mimeType}</p>
            <h3><f:message key="page.classification.proxy"/></h3>
            <p>${classify.classificationItem.proxyString}</p>
            <h3><f:message key="page.classification.searchPosition"/></h3>
            <p>${classify.classificationItem.searchPosition}</p>
            <h3><f:message key="page.classification.uuid"/></h3>
            <p>${classify.classificationItem.uuid}</p>
            <h3><f:message key="page.classification.wsdId"/></h3>
            <p>${classify.classificationItem.wsdId}</p>
            <h3><f:message key="page.classification.csId"/></h3>
            <p>${classify.classificationItem.csId}</p>
        </li>
    </ul>
    </s:layout-component>
</s:layout-render>